<template>
    <div class="app-container" ref="content">
        <div style="text-align: center;padding: 10px">任务《{{taskInfo.name}}》-详情信息</div>
        <el-row :gutter="10">
            <el-form :model="taskInfo" ref="taskInfo" label-width="150px">
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
                    <el-form-item label="所属主体:" prop="enterpriseName">
                        {{ taskInfo.enterpriseName }}
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
                    <el-form-item label="任务名称:" prop="taskName">
                        {{ taskInfo.taskName }}
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
                    <el-form-item label="任务类型" prop="type">
                        {{ taskInfo.type | taskType }}
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
                    <el-form-item label="任务描述:" prop="remark">
                        {{ taskInfo.remark }}
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
                    <el-form-item label="任务内容:" prop="content">
                        {{ taskInfo.content }}
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
                    <el-form-item label="任务状态:" prop="status">
                        {{ taskInfo.status == 1 ? "开启" : "关闭" }}
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
                    <el-form-item label="任务内容:" prop="content">
                        {{ taskInfo.content }}
                    </el-form-item>
                </el-col>
            </el-form>
        </el-row>
    </div>
</template>

<script>
import {getInTaskVo} from "@/api/taskinfo";

export default {
    name: "info",
    data(){
        return{
            taskInfo:{

            }
        }
    },
    created() {
        this.$nextTick(() => {
            this.getInTaskVo(this.$route.params.ucId)
        });
    },
    methods:{
        getInTaskVo(val){
            //获取企业信息数据
            let loadingInstance = this.$loading({
                target:this.$refs.content,
                text:'数据加载中'
            });
            getInTaskVo({ucId:val}).then(res=>{
                console.log(res)

                this.taskInfo = res.data
                loadingInstance.close()
                this.$notify.success({
                    title: '成功',
                    message: "获取任务信息成功"
                })
            }).catch(error=>{
                console.log(error)
                loadingInstance.close()
                this.$notify.error({
                    title: '失败',
                    message: "获取任务信息失败"
                })
            })
        },

    }

}
</script>
